home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1997 January / Macworld (1997-01).dmg / Shareware World / Maths & Science / DynRisk 4.0.3 / DynRisk-Help / DynRisk-Help.rsrc / TEXT_6519.txt < prev    next >
Text File  |  1996-08-30  |  1KB  |  19 lines

  1. Round
  2.  
  3. The Round function. This function lets you replace a linear function of the input value by the closest integer, multiplied by a constant. The function respects the usual ‚Äú.5‚Äù convention. Thus, the closest integer to e.g., 14.5 is 15, while the closest integer to e.g., -14.5 is 14.
  4.  
  5. By adjusting the parameters, you can create a large variety of round-off rules. Assume, e.g., that you want to replace the input value by the closest multiple of 0.5. To do this, enter 0.5 into the ‚Äúa‚Äù field, 2 into the ‚Äúb‚Äù field, and 0 into the ‚Äúc‚Äù field.
  6.  
  7. More generally, let A be a positive number. To replace the input value by the closest multiple of A, enter A into the ‚Äúa‚Äù field, 1/A into the ‚Äúb‚Äù field, and 0 into the ‚Äúc‚Äù field. 
  8.  
  9. You may enter negative parameter values as well. Note however, that the resulting rule reverses the ‚Äú.5‚Äù convention. Assume e.g., that you enter -1 both in the ‚Äúa‚Äù and the ‚Äúb‚Äù fields. Then an input value of 14.5 yields an output value of 14, while an input value of -14.5 yields an output value of -15.
  10.  
  11. Default parameter values:
  12.     a = 1, b = 1, c = 0
  13.  
  14. Example:
  15.     a = 10, b = 0.1, c = 0
  16.  
  17.     Input = 42  =>  Output = 40
  18.     Input = 56  =>  Output = 60
  19.